<template>
    <div class="block_main blue-tit">
        <!-- <div class="nytit">首页&gt;通知/督办</div> -->

        <el-row style="padding-top: 10px" v-loading="loading">
            <el-col :span="24" style="padding:0 5px">
                <el-card>
                    <div class="title">用户管理</div>
                    <!-- 筛选 -->
                    <el-form
                        style="padding:0px 20px"
                        :inline="true"
                        :model="filterData"
                        class="demo-form-inline"
                        size="small"
                    >
                        <el-form-item label="姓名">
                            <el-input v-model="filterData.name"></el-input>
                        </el-form-item>
                        <el-form-item label="电话">
                            <el-input v-model="filterData.phone"></el-input>
                        </el-form-item>
                        <el-form-item label="禁用状态">
                            <el-select v-model="filterData.is_disabled" placeholder="状态">
                                <el-option
                                    v-for="(dic,index) in statusArr"
                                    :label="dic.label"
                                    :value="dic.value"
                                    :key="index"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="交易次数">
                            <el-input v-model="filterData.order_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.order_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <el-form-item label="出售商品总数">
                            <el-input v-model="filterData.all_good_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.all_good_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <el-form-item label="待审商品数">
                            <el-input v-model="filterData.approval_good_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.approval_good_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <el-form-item label="在售商品数">
                            <el-input v-model="filterData.in_good_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.in_good_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <el-form-item label="求购商品总数">
                            <el-input v-model="filterData.all_buying_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.all_buying_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <el-form-item label="待审求购数">
                            <el-input v-model="filterData.approval_buying_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.approval_buying_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <el-form-item label="在求商品数">
                            <el-input v-model="filterData.in_buying_num_min" style="width:50px;"></el-input>&nbsp;-&nbsp;
                            <el-input v-model="filterData.in_buying_num_max" style="width:50px;"></el-input>
                        </el-form-item>
                        <!-- <el-form-item label="时间">
              <el-date-picker style="width:130px;"
                v-model="region.startTime"
                value-format="yyyy-MM-dd"
                type="date"
                placeholder="开始日期"
                @change="startChange">
              </el-date-picker>
              <i style="color:#666;font-size:14px;font-style:normal">至</i>
              <el-date-picker style="width:130px;"
                              v-model="region.endTime"
                              value-format="yyyy-MM-dd"
                              type="date"
                              placeholder="结束日期"
                              @change="endChange">
              </el-date-picker>
                        </el-form-item>-->
                        <!-- <el-form-item label="诉求分类">
              <el-select v-model="region.gname" placeholder="选择诉求分类">
                <el-option v-for="(list,index) in MessageGroupArr" :label="list.name" :value="list.name"
                           :key="index"></el-option>
              </el-select>
                        </el-form-item>-->

                        <el-button @click="Filter" size="small" type="primary">查询</el-button>
                        <el-button
                            type="primary"
                            size="small"
                            @click="exportList"
                        >导出</el-button>
                    </el-form>
                    <!-- 筛选结束 -->
                    <div class="block_main blue-tit">
                        <el-table :data="tableData" style="width: 100%" v-loading="loading">
                            <el-table-column type="index" width="70" label="序号" sortable fixed></el-table-column>
                            <el-table-column prop="name" label="姓名" width="80"></el-table-column>
                            <el-table-column prop="phone" width="120" label="电话"></el-table-column>
                            <el-table-column prop="all_good_num" label="全部出售商品" width="150" sortable>
                            </el-table-column>
                            <el-table-column prop="approval_good_num" width="120" label="待审商品"></el-table-column>
                            <el-table-column width="120" prop="in_good_num" label="在售商品"></el-table-column>
                            <el-table-column width="120" prop="all_buying_num" label="全部求购商品"></el-table-column>
                            <el-table-column width="120" prop="approval_buying_num" label="待审求购"></el-table-column>
                            <el-table-column width="120" prop="in_buying_num" label="在求商品"></el-table-column>
                            <el-table-column width="120" prop="order_num" label="交易次数"></el-table-column>
                            <el-table-column width="120" prop="is_disabled" label="操作">
                                <template slot-scope="scope">
                                    <el-button @click="changeStatus(scope.row)" type="text" size="small">{{getStatus(scope.row)}}</el-button>
                                </template>
                            </el-table-column>
                            <el-table-column prop="remark" width="200" label="备注"></el-table-column>
                        </el-table>
                    </div>
                    <!-- 翻页 -->
                    <div class="zpage">
                        <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            background
                            :current-page.sync="currentPage"
                            :page-size.sync="pagesize"
                            layout="total, prev, pager, next, jumper"
                            :total.sync="pagetotal"
                        ></el-pagination>
                    </div>
                    <!-- 翻页 end -->
                </el-card>
            </el-col>
        </el-row>

        <!-- 通用信息弹窗 -->
        <el-dialog :title="alertTit" :visible.sync="dialogInfoVisible" width="40%">
            <span>{{infoCon}}</span>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogInfoVisible = false">取 消</el-button>
                <el-button type="primary" @click="submitInfoDialog()">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import actionurl from "@/assets/js/actionurl";
import officeList from "@/components/manageOffice/List";
import selectMenu from "@/components/selectMenu.vue";
import selectMenuList from "@/components/selectMenuList.vue";
import config from "../../config";
import {
    get_user_list,
    user_export,
    user_setDisabled,

} from '@/api.js';
export default {
    name: "tableChart",
    components: {
        officeList,
        selectMenu,
        selectMenuList
    },

    data() {
        return {
            lianxi: 1,
            manyi: 1,
            tieUp: false,
            originArr: [],
            dialogTitle: "移交",
            overtime: "2018-12-12",
            httpHome: "",
            fileList3: [],
            alertTit: "信息",
            dialogInfoVisible: false,
            infoCon: "",
            isHide: false,
            dialogVisible: false,
            dialogVisibleMove: false,
            dialogVisibleSupervise: false,
            // 申诉弹窗
            dialogAcceptVisible: false,
            acceptDesc: "",
            acceptTitle: "",
            ThisID: "",
            cityArr: [],
            countyArr: [],
            MsgGroup: [],
            isShow: true,
            uType: 1200,
            isShowObj: {
                mamageShow: false, //是否运营人员
                officeShow: false, //是否办公室人员
                areaShow: false //是否区县人员
            },
            moveForm: {},
            superviseForm: {},
            region: {
                startTime: "",
                endTime: "",
                target: "",
                listStatus: "-1",
                from: "-1"
            },
            notice: {
                company: "",
                content: "",
                target: "",
                group: "",
                accepttime: ""
            },
            layerForm: {},
            targetArr: [],
            tableData: [],
            target: "",
            status: "",
            currentPage: 1,
            pagesize: 20,
            pagetotal: 10000,
            moveTarget: "",
            movegname: "",
            loading: false,
            MessageGroupArr: "",

            sname: "市级部门",
            sname2: "县长热线",
            dynamicValidateForm: {
                domains: [],
                selectList: [
                    {
                        value: "",
                        id: ""
                    }
                ]
            },
            options: [
                {
                    value: "10",
                    label: "测试部门",
                    id: "11"
                },
                {
                    value: "100",
                    label: "测试部门2",
                    id: "110"
                }
            ],
            dynamicValidateFormArea: {
                domains: [
                    {
                        value: "河北",
                        id: "12"
                    }
                ],
                selectList: [
                    {
                        value: "",
                        id: ""
                    }
                ]
            },
            optionsArea: [
                {
                    value: "10",
                    label: "安次区",
                    id: "11"
                },
                {
                    value: "101",
                    label: "安次区2",
                    id: "111"
                }
            ],

            filterData:{
                name:'',
                is_disabled:2,
                phone:'',
                all_good_num_min:'',
                all_good_num_max:'',
                approval_good_num_min:'',
                approval_good_num_max:'',
                in_good_num_min:'',
                in_good_num_max:'',
                all_buying_num_min:'',
                all_buying_num_max:'',
                approval_buying_num_min:'',
                approval_buying_num_max:'',
                in_buying_num_min:'',
                in_buying_num_max:'',
                order_num_min:'',
                order_num_max:'',
                sort:'',
                sort_type:''
            },
            statusArr:[
                {
                    label:'全部',
                    value:2
                },
                {
                    label:'正常',
                    value:0
                },
                {
                    label:'禁用',
                    value:1
                }
            ],
            sort:['all_good_num','approval_good_num','in_good_num','all_buying_num','approval_buying_num','in_buying_num','order_num'],
            sort_type:['asc','desc']   // 排序方式 正序: asc 倒序: desc
        };
    },
    methods: {
        startChange(val) {
            //开始时间控制
            if (val) {
                this.region.startTime = val + " 00:00";
            } else {
                this.region.startTime = val;
            }
        },
        endChange(val) {
            //结束时间控制
            if (val) {
                this.region.endTime = val + " 23:59";
            } else {
                this.region.endTime = val;
            }
        },
        // dialogDone() {

        //   this.dialogVisible = false;
        //   this.concludeUrlFn();
        //     // this.$message();

        // },
        closeDialog(done) {
            this.$confirm("确认关闭？")
                .then(_ => {
                    done();
                    this.tieUp = false;
                })
                .catch(_ => {});
        },
        concludeUrlFn() {
            // 办结接口
            var _this = this;
            actionurl.conclude(
                {
                    id: _this.ThisID,
                    lianxi: _this.lianxi,
                    manyi: _this.manyi,
                    content: _this.acceptDesc,
                    sup_attach: JSON.stringify(_this.fileList3)
                },
                function(re) {
                    _this.$message({
                        message: re.msg
                    });
                    // _this.$refs['form'].resetFields();
                    if (re.status == "1") {
                        _this.MessageList();
                        _this.fileList3 = [];
                        _this.dialogVisible = false;
                    } else {
                    }
                }
            );
        },
        childObjDone(row) {
            //办结弹窗
            console.log(row);
            this.ThisID = row.id;
            this.dialogAcceptVisible = true;
            this.acceptTitle = "办结";
            this.tieUp = true;
            // this.uploadFile = true;
            // this.dialogTit = "已办结";
            // this.dialogCon = "办结内容";
        },
        fileSuccess(event, file, fileList) {
            var obj = {};
            obj.name = file.name;
            obj.url = file.response.data.path;
            this.fileList3.push(obj);
        },
        handlemove(file, fileList) {
            // this.fileList3 = fileList;

            this.loading = true;
            var data = this.fileList3.filter(function(item) {
                return item.uid == file.uid;
            });
            this.fileList3.del(function(obj) {
                return obj.uid == data;
            });
            var _this = this;
            _this.fileRemove(file, _this.fileList3);
        },
        fileRemove(file, fileList) {
            var _this = this;
            actionurl.delfile(
                {
                    file: file.url
                },
                function(re) {
                    if ((re.status = 1)) {
                        _this.$message(re.msg);
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        //获取子组件移交按钮事件
        childObjmoveTo(obj) {
            this.ThisID = obj.id;
            this.dialogVisibleMove = true;
            var _this = this;
            actionurl.MgetTransferInfo(
                {
                    //获取移交的诉求详细信息
                    id: obj.id
                },
                function(re) {
                    if (re.status == 1) {
                        // console.log(re.data.city);
                        _this.dynamicValidateForm = {
                            domains: re.data.city,
                            selectList: [
                                {
                                    value: "选择",
                                    id: "0"
                                }
                            ]
                        };
                        _this.dynamicValidateFormArea = {
                            domains: re.data.county,
                            selectList: [
                                {
                                    value: "选择",
                                    id: "0"
                                }
                            ]
                        };

                        _this.movegname = re.data.group;
                        _this.GetMsgGroup();
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        dialogMove() {
            //移交操作
            if (
                this.$refs.mesage.getContent().length == 0 &&
                this.$refs.mesage2.getContent().length == 0
            ) {
                this.$message("请选择县长热线或者请选择市级部门");
                return;
            }
            var _this = this;
            // console.log(this.movegname, this.cityArr, this.countyArr);
            actionurl.MuserTransfer(
                {
                    //获取移交的诉求详细信息
                    id: _this.ThisID,
                    group: _this.movegname,
                    city: _this.$refs.mesage.getContent().join(","),
                    county: _this.$refs.mesage2.getContent().join(","),
                    final_time: _this.overtime
                },
                function(re) {
                    if (re.status == 1) {
                        _this.MessageList();
                        _this.dialogVisibleMove = false;
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        //获取子组件编辑按钮事件
        childObjEdit(obj) {
            console.log(obj);
            this.$router.push({
                path: "/questionEdit/" + obj.id
            });
        },
        childObjSupervise(obj) {
            this.dialogVisibleSupervise = true;
        },
        childObjAccept(obj) {
            //获取子组件受理按钮
            this.fileList3 = [];
            this.ThisID = obj.id;
            this.acceptTitle = "受理";
            this.dialogAcceptVisible = true;
        },
        childObjcomplain(obj) {
            //获取子组件申诉按钮
            this.fileList3 = [];
            this.ThisID = obj.id;
            this.acceptTitle = "申诉";
            this.dialogAcceptVisible = true;
        },
        childObjApproval(obj) {
            //获取子组件核准按钮

            this.ThisID = obj.id;
            this.dialogVisibleMove = true;
            this.dialogTitle = "核准";
            var _this = this;

            actionurl.MgetTransferInfo(
                {
                    id: obj.id
                },
                function(re) {
                    // console.log(re);
                    _this.overtime = re.data.final_time;
                    if (re.status == 1) {
                        _this.dynamicValidateForm = {
                            domains: re.data.city,
                            selectList: [
                                {
                                    value: "选择",
                                    id: "0"
                                }
                            ]
                        };
                        _this.dynamicValidateFormArea = {
                            domains: re.data.county,
                            selectList: [
                                {
                                    value: "选择",
                                    id: "0"
                                }
                            ]
                        };
                        _this.movegname = re.data.group;
                        _this.GetMsgGroup();
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        dialogCheck() {
            //核准操作
            if (
                this.$refs.mesage.getContent().length == 0 &&
                this.$refs.mesage2.getContent().length == 0
            ) {
                this.$message("请选择县长热线或者请选择市级部门");
                return;
            }
            var _this = this;
            actionurl.MyxTransfer(
                {
                    //获取移交的诉求详细信息
                    id: _this.ThisID,
                    group: _this.movegname,
                    city: _this.$refs.mesage.getContent().join(","),
                    county: _this.$refs.mesage2.getContent().join(","),
                    final_time: _this.overtime
                },
                function(re) {
                    if (re.status == 1) {
                        _this.$message(re.msg);
                        _this.dialogVisibleMove = false;
                        _this.MessageList();
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        update(name) {
            // console.log(name);
        },
        updateArea(name) {
            // console.log(name);
        },
        handleUpload() {},
        superDetail(row) {
            //督办按钮

            this.$router.push({
                path: "/supervise/" + row.id
            });
        },
        updateData(row) {
            //修改事件
            this.dialogVisible = true;
            this.notice.company = row.company;
            this.notice.content = row.content;
            this.notice.target = row.target;
            this.notice.gname = row.gname;
            this.notice.accepttime = row.accepttime;
            //修改弹窗字段
            this.movegname = row.gname;

            this.questionClass();
        },
        MessageList() {
            // 获取列表
            var _this = this;
            if (_this.uType == 2) {
                actionurl.wbWaitList(
                    {
                        pageNum: _this.pagesize,
                        pageOn: _this.currentPage,
                        status: _this.region.listStatus,
                        start: _this.region.startTime,
                        end: _this.region.endTime,
                        target: _this.region.target
                    },
                    function(re) {
                        // console.log(re);
                        _this.loading = false;
                        if (re.status == 1) {
                            _this.tableData = re.data;
                            _this.pagetotal = re.count;
                            //
                        } else {
                            _this.$message(re.msg);
                        }
                    }
                );
            } else {
                actionurl.MgetWaitList(
                    {
                        pageNum: _this.pagesize,
                        pageOn: _this.currentPage,
                        status: _this.region.listStatus,
                        start: _this.region.startTime,
                        end: _this.region.endTime,
                        target: _this.region.target,
                        from: _this.region.from
                    },
                    function(re) {
                        // console.log(re);
                        _this.loading = false;
                        if (re.status == 1) {
                            _this.tableData = re.data;
                            _this.pagetotal = re.count;
                        } else {
                            _this.$message(re.msg);
                        }
                    }
                );
            }
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            // this.currentPage == val;
            console.log(this.currentPage);
            this.MessageList();
        },
        intoDetail(row, event, column) {
            this.$router.push({
                path: "/supervise/" + row.id
            });
        },
        targetListFn() {
            var _this = this;
            actionurl.targetList({}, function(re) {
                // console.log(re);
                if (re.status == 1) {
                    _this.targetArr = re.data;
                } else {
                    _this.$message(re.msg);
                }
            });
        },
        questionClass() {
            //获取
            var _this = this;
            actionurl.MessageGroup(
                {
                    mesgroup: 1, //0-面对面等分类 1-八大类
                    fid: 1
                },
                function(re) {
                    // console.log(re);
                    if (re.status == 1) {
                        _this.MessageGroupArr = re.data;
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },
        AddQuestion() {
            this.$router.push({
                path: "/questionAdd"
            });
        },
        getUserinfo() {
            //获取用户信息
            var _this = this;

            actionurl.getUserInfo({}, function(re) {
                _this.uType = re.userType;
                _this.MessageList();
                switch (re.userType) {
                    case 1: //运营人员
                        _this.isShowObj.mamageShow = true;
                        break;
                    case 2: //区县账号
                        _this.isShowObj.areaShow = true;

                        break;
                    case 3: //运行局账号
                        _this.isShowObj.officeShow = true;
                        _this.isHide = true;
                        break;
                }
            });
        },
        update(name) {
            //获取市级增加的菜单数组
            this.cityArr = name;
        },
        updateArea(name) {
            //获取区县级增加的菜单数组
            this.countyArr = name;
        },
        GetTargetList() {
            //获取区县以及市级下拉菜单获取
            var _this = this;
            actionurl.targetListByType({}, function(re) {
                _this.options = re.data.city;
                _this.optionsArea = re.data.county;
            });
        },
        GetMsgGroup() {
            //获取诉求分类
            var _this = this;
            actionurl.MessageGroup(
                {
                    mesgroup: 1, //0-面对面等分类 1-八大类
                    fid: 1
                },
                function(re) {
                    console.log(re);
                    _this.MsgGroup = re.data;
                }
            );
        },
        dismissAcceptDialog() {
            this.acceptDesc = "";
            this.dialogAcceptVisible = false;
            this.tieUp = false;
        },
        submitAcceptDialog() {
            //受理和申诉事件
            this.dialogAcceptVisible = false;
            var _this = this;
            if (this.acceptTitle == "受理") {
                actionurl.ShouLiOption(
                    {
                        id: _this.ThisID,
                        content: _this.acceptDesc,
                        sup_attach: JSON.stringify(_this.fileList3)
                    },
                    function(re) {
                        console.log(re);
                        if (re.status == 1) {
                            _this.MessageList();
                            _this.$message({
                                message: "受理成功",
                                type: "success"
                            });
                        } else {
                            _this.$message({
                                message: re.message,
                                type: "warning"
                            });
                        }
                    }
                );
            } else if (this.acceptTitle == "申诉") {
                actionurl.ShenSuOption(
                    {
                        id: _this.ThisID,
                        remarks: _this.acceptDesc,
                        sup_attach: JSON.stringify(_this.fileList3)
                    },
                    function(re) {
                        console.log(re);
                        if (re.status == 1) {
                            _this.MessageList();
                            _this.$message({
                                message: "申诉成功",
                                type: "success"
                            });
                        } else {
                            console.log(re.data);
                            _this.$message({
                                message: re.message,
                                type: "warning"
                            });
                        }
                    }
                );
            } else if (this.acceptTitle == "办结") {
                _this.concludeUrlFn();
            }
            _this.acceptDesc = "";
        },
        fileSuccess(event, file, fileList) {
            var obj = {};
            obj.name = file.name;
            obj.url = file.response.data.path;
            this.fileList3.push(obj);
        },

        handlemove(file, fileList) {
            // this.fileList3 = fileList;

            // this.loading = true;
            var data = this.fileList3.filter(function(item) {
                return item.uid == file.uid;
            });
            this.fileList3.del(function(obj) {
                return obj.uid == data;
            });
            var _this = this;
            _this.fileRemove(file, _this.fileList3);
        },
        fileRemove(file, fileList) {
            var _this = this;
            actionurl.delfile(
                {
                    file: file.url
                },
                function(re) {
                    if ((re.status = 1)) {
                        _this.$message(re.msg);
                    } else {
                        _this.$message(re.msg);
                    }
                }
            );
        },

        // 二手锅炉平台
        async getList() {
            try {
                let param = {
                    size: this.pagesize,
                    page: this.currentPage,
                    name: this.filterData.name,
                    phone: this.filterData.phone,
                    is_disabled: this.filterData.is_disabled,
                    all_good_num_min: this.filterData.all_good_num_min,
                    all_good_num_max: this.filterData.all_good_num_max,
                    approval_good_num_min: this.filterData.approval_good_num_min,
                    approval_good_num_max: this.filterData.approval_good_num_max,
                    in_good_num_min: this.filterData.in_good_num_min,
                    in_good_num_max: this.filterData.in_good_num_max,
                    all_buying_num_min: this.filterData.all_buying_num_min,
                    all_buying_num_max: this.filterData.all_buying_num_max,
                    approval_buying_num_min: this.filterData.approval_buying_num_min,
                    approval_buying_num_max: this.filterData.approval_buying_num_max,
                    in_buying_num_min: this.filterData.in_buying_num_min,
                    in_buying_num_max: this.filterData.in_buying_num_max,
                    order_num_min: this.filterData.order_num_min,
                    order_num_max: this.filterData.order_num_max,
                    sort: this.filterData.sort,
                    sort_type: this.filterData.sort_type
                };
                let result = await get_user_list(param);
                this.loading = false;
                // console.log(result.data.data);
                if (result.data.status == 1) {
                    this.tableData = result.data.data.list;
                    this.pagetotal = result.data.data.total;
                }
            } catch (error) {
                console.log(error);
            }
        },
        getStatus(row) {
            if (row.is_disabled == 0) {
                return '禁用';
            } else {
                return '正常';
            }
        },
        async changeStatus(row) { //
            this.loading = true;
            let value = 1-row.is_disabled;
            console.log(value);
            try {
                let param = {
                    id:row.id,
                    is_disabled: value
                };
                let result = await user_setDisabled(param);
                this.loading = false;
                // console.log(result.data.data);
                if (result.data.status == 1) {
                    this.$message('用户状态修改成功！');
                    this.getList();
                } else {
                    this.$message(result.data.msg);
                }
            } catch (error) {
                console.log(error);
            }
        },
        Filter() {
            this.loading = true;
            this.getList();
        },
        async exportList() {
            // let url = this.httpHome + "admin/user/export?"+'name='+this.filterData.name+'&phone'+this.filterData.phone+'&is_disabled'+this.filterData.is_disabled+'&all_good_num_min'+this.filterData.all_good_num_min+'&all_good_num_max'+this.filterData.all_good_num_max+'&approval_good_num_min'+this.filterData.approval_good_num_min+'&approval_good_num_max'+this.filterData.approval_good_num_max+'&in_good_num_min'+this.filterData.in_good_num_min+'&in_good_num_max'+this.filterData.in_good_num_max+'&all_buying_num_min'+this.filterData.all_buying_num_min+'&all_buying_num_max'+this.filterData.all_buying_num_max+'&approval_buying_num_min'+this.filterData.approval_buying_num_min+'&approval_buying_num_max'+this.filterData.approval_buying_num_max+'&in_buying_num_min'+this.filterData.in_buying_num_min+'&in_buying_num_max'+this.filterData.in_buying_num_max+'&order_num_min'+this.filterData.order_num_min+'&order_num_max'+this.filterData.order_num_max+'&sort'+this.filterData.sort+'&sort_type'+this.filterData.sort_type;
            // location.href = url;

            try {
                let param = {
                    name: this.filterData.name,
                    phone: this.filterData.phone,
                    is_disabled: this.filterData.is_disabled,
                    all_good_num_min: this.filterData.all_good_num_min,
                    all_good_num_max: this.filterData.all_good_num_max,
                    approval_good_num_min: this.filterData.approval_good_num_min,
                    approval_good_num_max: this.filterData.approval_good_num_max,
                    in_good_num_min: this.filterData.in_good_num_min,
                    in_good_num_max: this.filterData.in_good_num_max,
                    all_buying_num_min: this.filterData.all_buying_num_min,
                    all_buying_num_max: this.filterData.all_buying_num_max,
                    approval_buying_num_min: this.filterData.approval_buying_num_min,
                    approval_buying_num_max: this.filterData.approval_buying_num_max,
                    in_buying_num_min: this.filterData.in_buying_num_min,
                    in_buying_num_max: this.filterData.in_buying_num_max,
                    order_num_min: this.filterData.order_num_min,
                    order_num_max: this.filterData.order_num_max,
                    sort: this.filterData.sort,
                    sort_type: this.filterData.sort_type
                };
                let result = await user_export(param);
                // window.open()
            } catch (error) {
                console.log(error);
            }
        },


    },
    mounted() {},
    updated() {},
    created() {
        this.originArr = config.originArr;
        // this.getUserinfo();
        // this.targetListFn();
        //
        // this.GetTargetList();
        this.httpHome = config.URLWEBHTTP;
        // this.questionClass();
        //设置默认截止日期
        function addZero(n) {
            return n < 10 ? "0" + n : "" + n;
        }
        var ddd = new Date();
        var month = ddd.getMonth() + 1;
        var day = ddd.getDate() + 7;
        var year = ddd.getFullYear();
        if (month == 0) {
            month = 12;
            year = year - 1;
        }
        if (month < 10) {
            month = addZero(month);
        }
        this.overtime = year + "-" + month + "-" + day;

        // 二手锅炉平台
        this.getList();


    }
};
</script>
<style scoped lang="scss">
.persent {
    width: 80%;
    height: 10px;

    display: flex;
    justify-content: space-between;
    position: relative;
    padding-right: 40px;

    span {
        background: #ccc;
        width: 100%;
        line-height: 10px;

        b {
            background: green;
            width: 100%;
            height: 100%;
            display: inline-block;
            float: left;
        }
    }

    em {
        line-height: 10px;
        position: absolute;
        right: 0;
    }
}

.demo-table-expand {
    font-size: 0;
}

.demo-table-expand label {
    width: 90px;
    color: #99a9bf;
}

.demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 90%;
}

.layerup {
    h2 {
        font-size: 18px;
        font-weight: normal;
        text-align: center;
        margin-bottom: 15px;
    }

    span {
        width: 46%;
        line-height: 20px;
    }

    p {
        display: flex;
        justify-content: space-between;
        color: #999;
        margin-bottom: 10px;
    }

    hr {
        border: 1px solid #f5f5f5;
        margin-top: 15px;
    }
}

.titlehover {
    cursor: pointer;

    &:hover {
        color: #1d82d2;
    }
}
</style>
